﻿using System.ComponentModel;

namespace Dgg.LearnYourTools.NUnit.C_Assertions.Support
{
	public class EventRaisingSubject : INotifyPropertyChanging
	{
		public event PropertyChangingEventHandler PropertyChanging;
		protected virtual void OnChanging(string name)
		{
			PropertyChangingEventHandler handler = PropertyChanging;
			if (handler != null) handler(this, new PropertyChangingEventArgs(name));
		}

		private int _i;
		public int I
		{
			get { return _i; }
			set
			{
				OnChanging("I");
				_i = value;
			}
		}

		private string _s;
		public string S
		{
			get { return _s; }
			set
			{
				OnChanging("S");
				_s = value;
			}
		}
	}
}
